<?php

namespace Cck\ArticlesSystem\Http\Controllers;

use Cck\ArticlesSystem\Http\Requests\ImageUploadRequest;

class FilesystemController extends Controller
{
    public function uploadImage(ImageUploadRequest $request)
    {
        $path = \put_file($request->file('image'));

        return [
            'path' => $path,
            'url' => \get_file_url_by_path($path)
        ];
    }
}
